package com.maxjay.component.metadata.core.command;

import com.maxjay.component.metadata.model.Entity;
import com.maxjay.component.metadata.model.Record;

/**
 * Entity的创建命令
 * 
 * @author zhaixm
 *
 */
public class CreateEntityCommand extends JdbcEntityCommand {
	
	public CreateEntityCommand(Entity entity, Record record) {
		super(entity, record);
	}
	
	@Override
	public void execute() {
//		for (EntityInterceptor entityInterceptor : entity.getEntityInterceptors()) {
//			entityInterceptor.beforeCreate(entity, records);
//		}
		this.getEntityService().save(entity, records);
//		for (EntityInterceptor entityInterceptor : entity.getEntityInterceptors()) {
//			entityInterceptor.afterCreate(entity, records);
//		}
	}

}
